﻿//===========================[ 7 / 31 / 2011 LVI ]=============================
//				Copyright c Vitaly Lyaschenko <SkyChameleon@gmail.com>
//								Source file
// Purpose: 
//=============================================================================
#pragma once

#include "App.h"

#include "common.h"

class IObject
{
public:
	IObject(void) {	}
	virtual ~IObject(void) { }

	virtual void init( const std::string& nameMesh, bool buildFlag = false ) = 0;
	virtual void draw() = 0;
	virtual void release() = 0;
	virtual void update() = 0;
};

///////////////////////////////////////////////////////////////////////////
// видимые объекты "сущности"
class Shape : public IObject
{
	cMesh *m_Model;

	//  VAO / VBO ...
	cVAO m_VAO;
	cVBO m_VBO_Pos,
		 m_VBO_Normal,
		 m_VBO_TexCoor,
		 m_VBO_Indices;

	bool m_buildFlag;
	void build();

public:
	Shape();
	~Shape();

	mat4 mtrModel;

	virtual void init( const std::string& fileName, bool buildFlag = false );
	virtual void draw();
	virtual void release();

	//mat4 & getModelMtr()
	//{
	//	return m_ModelMtr;
	//}

	void update();
};